home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / src / config / auto-aux / bytecopy.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-18  |  479 b   |  20 lines  |  [TEXT/R*ch]

  1. char buffer[27];
  2.  
  3. #ifdef reverse
  4. #define cpy(s1,s2,n) copy(s2,s1,n)
  5. #else
  6. #define cpy copy
  7. #endif
  8.  
  9. main()
  10. {
  11.   cpy("abcdefghijklmnopqrstuvwxyz", buffer, 27);
  12.   if (strcmp(buffer, "abcdefghijklmnopqrstuvwxyz") != 0) exit(1);
  13.   cpy(buffer, buffer+3, 26-3);
  14.   if (strcmp(buffer, "abcabcdefghijklmnopqrstuvw") != 0) exit(1);
  15.   cpy("abcdefghijklmnopqrstuvwxyz", buffer, 27);
  16.   cpy(buffer+3, buffer, 26-3);
  17.   if (strcmp(buffer, "defghijklmnopqrstuvwxyzxyz") != 0) exit(1);
  18.   exit(0);
  19. }
  20.